package com.e3.basdoc.warehouse.model;

import java.util.ArrayList;
import java.util.List;

import com.e3.web.core.model.SuperQC;

public class WarehouseQC extends SuperQC {

	private static final long serialVersionUID = -7376589830664121684L;

	private String code;
	
	private String name;
	
	private String status;
	
	private String type;
	
	public String getCode() {
		return code;
	}


	public void setCode(String code) {
		this.code = code;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public String getStatus() {
		return status;
	}


	public void setStatus(String status) {
		this.status = status;
	}


	public String getType() {
		return type;
	}


	public void setType(String type) {
		this.type = type;
	}

	@Override
	public List<String> getWhereList() {
		List<String> fields = new ArrayList<String>();
		if (getCode() != null) {
			String code = getCode().trim();
			if (code.length() > 0) {
				fields.add(getStringStatement("code", code));
			}
		}

		if (getName() != null) {
			String name = getName().trim();
			if (name.length() > 0) {
				fields.add(getStringStatement("name", name));
			}
		}

		if(getStatus()!=null){
			String strStatus = getStatus().trim();
			if(strStatus.length()>0){
				int status = Integer.parseInt(strStatus);
				fields.add(getNumEqualsStatement("status",status));
			}
		}
		
		if(getType()!=null){
			String strType = getType().trim();
			if(strType.length()>0){
				int type = Integer.parseInt(strType);
				fields.add(getNumEqualsStatement("type",type));
			}
		}
		
		return fields;
	}

}
